<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	#bd{
		border: 0px solid;
		width: 840px;
		height:470px;
	}
	#bt{
		
		width:200px;
		height:50px;
		font-family:"华文行楷";
		font-size:30px;
		margin-top:3%;
	 }
	 #tab{
	 	table-layout: fixed;
		word-break:break-all;
		width:100%;
		border-collapse:collapse;
		font-size:20px;
		font-family:"隶书";
	 	
	 	
	 }
	 #td{
	 	
	 }
	 .ou{
		 	background-color:#99cc33;
			text-align:center;
	}
	.ji{
	 	background-color:#ccffff;
		text-align:center;
	}
	#first{
		float: left;
		margin-left: 70px;
		font-size: 25px;
	}
	#last{
		float: left;
		margin-left: 150px;
		font-size: 25px;
	}
	#next{
		float: left;
		margin-left: 150px;
		font-size: 25px;
	}
	#final{
		float: left;
		margin-left: 150px;
		font-size: 25px;
	}
	a:{color:black;}
	a:visited{
	color:black;
	}
	a:hover{
	color:red
	}
	a:active{
	color:black;
	}
</style>
</head>
<body>
<div id="bd">
	<div id="bt">
		用户阅览
	</div>
	<div id="content">
	  <table id="tab">
		<tr><th>ID</th> <th>科目</th> <th>详情</th> <th>编辑</th></tr>
		<c:set var="i" value="0"></c:set>
		<c:forEach var="us" items="${sub }">
				<c:choose>
					<c:when test="${i%2==1 }">
				<tr class="ji">
					<td><c:out value="${us.id }"></c:out></td>
					<td><c:out value="${us.name }"></c:out></td>
					<td><c:out value="${us.description }"></c:out></td>
					<td><a href="sbianji?id=${us.id }">编辑</a></td>
				</tr>	
			</c:when>
			<c:otherwise>
				<tr class="ou">
			
					<td><c:out value="${us.id }"></c:out></td>
					<td><c:out value="${us.name }"></c:out></td>
					<td><c:out value="${us.description }"></c:out></td>
					<td><a href="sbianji?id=${us.id }">编辑</a></td>
				</tr>
			</c:otherwise>
				</c:choose>
			<c:set var="i" value="${i+1 }"></c:set>
			</c:forEach>
	  </table>			
	  
	</div>	
		
	<div id="bottom">
		<c:choose>
			<c:when test="${page==0}">
				<div id="first">
					首页
				</div>
				<div id="last">
					上一页
				</div>
			</c:when>
			<c:otherwise>
				<div id="first">
					<a href="syuelan?pagenow=0">首页</a>
				</div>
				<div id="last">
					<a href="syuelan?pagenow=${page-1 }">上一页</a>
				</div>
			</c:otherwise>
		
		</c:choose>
		<c:choose>
				<c:when test="${page==size}">
				<div id="next">
					下一页
				</div>
				<div id="final">
					尾页
				</div>
			</c:when>
			<c:otherwise>
				<div id="next">
					<a href="syuelan?pagenow=${page+1}">下一页</a>
				</div>
				<div id="final">
					<a href="syuelan?pagenow=${size}">尾页</a>
				</div>
			</c:otherwise>
		</c:choose>
	
	</div>
</div>
</body>
</html>